#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QMainWindow>
#include <QFileDialog>
#include <QUdpSocket>
#include <QtCharts/QChartView>
#include <QtCharts/QLineSeries>
#include <QTabWidget>
#include "wave.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    void udp_init(); //udp初始化
    void  ui_init();
    void readPendingDatagrams();

private slots:
    void on_updlink_clicked();

    void on_pushButton_4_clicked();
    void read_data();
    void on_start_clicked();

    void on_pushButton_clicked();

private:
    Ui::MainWindow *ui;
    QUdpSocket *m_Socket = nullptr; //udp通信
    wave *m_wave; //波形图
    wave *m_wave1; //波形图
    wave *m_wave2; //波形图
    QTabWidget *m_tabWidget;
    //保存对方的ip的信息
    QHostAddress address;
    quint16 port;
    bool isaddress = false; //获取对面id标志
    QString m_Node[2]; //构造节点信息
    int m_Node_Lenth = 0;//节点长度
};
#endif // MAINWINDOW_H
